home *** CD-ROM | disk | FTP | other *** search
- /*
- ** AGA WhiteFade Demo
- ** ------------------
- ** There are three examples of fading in this program: ColourMorph(),
- ** ColourToPalette(), and PaletteToColour().
- **
- ** To compile with SAS/C
- ** 1> sc WhiteFade.c link startup=LIB:gms.o data=far
- **
- */
-
- #include <proto/games.h>
-
- extern struct GMSBase *GMSBase;
- ULONG _XCEXIT = NULL;
- APTR PREFSNAME = DEFAULT;
-
- void main(void)
- {
- UWORD FadeState = 0;
- struct GameScreen *GameScreen;
- struct Picture *Picture;
-
- if (Picture = LoadPicFile("GMS:demos/data/PIC.Loading",GETPALETTE|VIDEOMEM)) {
-
- if (GameScreen = AddScreenTags(TAGS_GAMESCREEN,NULL,
- GSA_MemPtr1,Picture->Data,
- GSA_ScrWidth,320,
- GSA_ScrHeight,256,
- GSA_AmtColours,Picture->AmtColours,
- GSA_PicWidth,Picture->Width,
- GSA_PicHeight,Picture->Height,
- GSA_Planes,Picture->Planes,
- GSA_ScrMode,Picture->ScrMode,
- GSA_ScrType,Picture->ScrType,
- TAGEND)) {
-
- ShowScreen(GameScreen);
-
- do { WaitVBL();
- FadeState = ColourMorph(GameScreen,FadeState,10,0,32,0x000000,0xFFFFFF);
- } while (FadeState != NULL);
-
- do { WaitVBL();
- FadeState = ColourToPalette(GameScreen,FadeState,2,0,32,Picture->Palette,0xFFFFFF);
- } while (FadeState != NULL);
-
- do { WaitVBL();
- FadeState = PaletteToColour(GameScreen,FadeState,2,0,32,Picture->Palette,0x000000);
- } while (FadeState != NULL);
-
- FreePic(Picture);
- }
- DeleteScreen(GameScreen);
- }
- }
-
-